#ifndef CLIENTMESSAGEHANDLE_H
#define CLIENTMESSAGEHANDLE_H

#include "resip/dum/PagerMessageHandler.hxx"
#include "resip/dum/ClientPagerMessage.hxx"

#include <string>

class Controller;


class ClientMessageHandler : public resip::ClientPagerMessageHandler
{
public:
	// Constructor & Destructor

	ClientMessageHandler(Controller* parent);
	virtual ~ClientMessageHandler();

	// Memberfunctions

	void initialize();
	void cleanup();

	bool isDone(){ return m_done; }
	void setDone(bool done){ m_done = done; }

	// Callbacks

	virtual void onSuccess(resip::ClientPagerMessageHandle h, const resip::SipMessage & status);
	virtual void onFailure(resip::ClientPagerMessageHandle h, const resip::SipMessage & status, std::auto_ptr<resip::Contents> contents);

private:
	// Memberfunctions

	std::string parseContactName(std::string from);

	// Membervariables

	Controller* m_owner;
	bool m_done;
};

#endif